package org.misalen.web.database.model.mysql.sys;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.misalen.annotations.DataAccess;
import org.misalen.annotations.ModelComment;
import org.misalen.web.database.model.mysql.BaseSqlModel;

/**
 * 管理员
 * 
 * @author guochao
 *
 */
@Entity
@Table(name = "SysAdmin")
@DynamicInsert(true)
@DynamicUpdate(true)
public class SysAdmin extends BaseSqlModel {

	@ModelComment("用户名")
	@Column(name = "username", length = 50, unique = true, nullable = false)
	private String username;

	@ModelComment("昵称")
	@ColumnDefault("''")
	@Column(name = "nickname", length = 50)
	private String nickname;

	@ModelComment("登录密码")
	@Column(name = "loginPwd", length = 50, nullable = false)
	@DataAccess(add = true, list = true, search = true, update = true)
	private String loginPwd;

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getLoginPwd() {
		return loginPwd;
	}

	public void setLoginPwd(String loginPwd) {
		this.loginPwd = loginPwd;
	}

}
